package com.lfy.modules.blog.controller;

import com.lfy.modules.blog.domain.vo.index.IndexVO;
import com.lfy.modules.blog.service.IndexService;
import com.lfy.modules.common.anno.AutoUser;
import com.lfy.modules.common.domain.R;
import com.lfy.modules.common.domain.entity.UserEntity;
import com.lfy.modules.safety.domain.vo.VisitorLogVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/admin/index")
public class IndexController {
    @Resource
    private IndexService indexService;
    @GetMapping("/info")
    public R<IndexVO> index(@AutoUser UserEntity user) {
        return indexService.getBlogIndex(user);
    }
    @GetMapping("/look/detail/{date}")
    public R<List<VisitorLogVO>> lookDetail(@AutoUser UserEntity user, @PathVariable("date") String date) {
        return indexService.getLookDetailByDate(user, date);
    }


}
